package Thread;


public class demo1 {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while(true) {
                System.out.println("hello bit");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        },"这是一个新进程！！");
        //启动线程 ,两个线程之间执行的顺序是不确定的
        t.start();
        while(true) {
            System.out.println("hello byte");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
